package io;

import com.google.common.collect.Maps;
import org.apache.commons.io.FileUtils;

import java.io.File;
import java.io.IOException;
import java.util.List;
import java.util.Map;

/**
 * @Author: ycy
 * @CreateDate: 2019/8/6 15:07
 */
public class FileDemo2 {

  public static void main(String[] args) {

    try {
      List<String> buslist = FileUtils.readLines(new File("D:\\Users\\yincy\\Desktop\\das需求\\交通\\旅游线路\\bus.txt"), "UTF-8");
      Map<String, String> bus = Maps.newHashMap();
      for (String line : buslist) {
        String trim = line.trim();
        trim = trim + "到" + trim + "旅游专线";
        bus.put(trim, trim);
      }

      List<String> srclist = FileUtils.readLines(new File("D:\\Users\\yincy\\Desktop\\das需求\\交通\\旅游线路\\src.txt"), "UTF-8");
      Map<String, String> src = Maps.newHashMap();
      for (String line : srclist) {
        String trim = line.trim();
        src.put(trim, trim);
      }

      for (Map.Entry<String, String> entry : bus.entrySet()) {
        if(!src.containsKey(entry.getKey())){
          System.out.println(entry.getKey());
        }
      }

    } catch (IOException e) {
      e.printStackTrace();
    }

  }

}
